package com.shujia.day19.danlidemo;

/*
    懒汉式
 */
// t1, t2, t3
public class Student2 {
    private static Student2 student2;

    private Student2(){}

    public synchronized static Student2 getStudent2(){
        if(student2==null){
            // t1 , t2, t3
            student2 = new Student2();
        }

        return student2;
    }
}
